package com.xgggh.redpack.ui.redpack.viewbinder;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;

import com.xgggh.redpack.R;
import com.xgggh.redpack.base.viewbinder.BinderViewHolder;
import com.xgggh.redpack.databinding.ContentCategoryItemBinding;
import com.xgggh.redpack.domain.category.CategoryItem;

import me.drakeet.multitype.ItemViewBinder;
//评论
public class OpenRedPackCommentViewBinder extends ItemViewBinder<CategoryItem, BinderViewHolder> {

    @NonNull
    @Override
    protected BinderViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
      ContentCategoryItemBinding binding= DataBindingUtil.inflate(inflater,R.layout.content_category_item,parent,false);
        return new BinderViewHolder(binding.getRoot());
    }

    @Override
    protected void onBindViewHolder(@NonNull BinderViewHolder holder, @NonNull CategoryItem item) {
        ContentCategoryItemBinding binding= DataBindingUtil.getBinding(holder.itemView);
        binding.setItem(item);
    }

}
